﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Gmis.Web.Manage.Party
{
    public partial class PSystem : System.Web.UI.Page
    {
     
        protected void Page_Load(object sender, EventArgs e)
        {
         
        }

        //获取制度文件
        public string GetSystem()
        {
            BLL.PSystem bll = new BLL.PSystem();
            List<Model.PSystem> list = bll.GetModelList(" 1=1 Order By sNumber ");

            if (list == null || list.Count < 1)
            {
                return "没有数据";
            }

            //string str = " <li>";
            //str += "<a onclick=\"javascript:content.src='{0}'\" href=\"#\" title=\"{1}\">{1}</a>";//照片
            //str += "<a title=\"编辑\" target=\"dialog\" href=\"Party/PSystemEdit.aspx?action=edit&id={2}\" width=\"800\" height=\"550\" class=\"btnEdit\"></a>";//
            //str += "<a title=\"删除\" target=\"ajaxTodo\" href=\"Party/PSystemHandler.ashx?action=delete&id={2}\" class=\"btnDel\"></a>";//
            //str += "</li>";
            //string resultStr = "";
            //foreach (Model.PSystem b in list)
            //{
            //    resultStr += string.Format(str,Gmis.Public.CommonFunction.GetSystemPath() + b.sPicture,b.sTitle,b.sId);
            //}
            //return resultStr;

            string str = "<tr><td>{3}</td><td><a onclick=\"javascript:content.src='{0}'\" href=\"#\" title=\"{1}\">{1}</a></td>";//照片
            str += "<td><a title=\"编辑\" target=\"dialog\" href=\"Party/PSystemEdit.aspx?action=edit&id={2}\" width=\"800\" height=\"550\" class=\"btnEdit\"></a>";//
            str += "<a title=\"删除\" target=\"ajaxTodo\" href=\"Party/PSystemHandler.ashx?action=delete&id={2}\" class=\"btnDel\"></a></td></tr>";//

            string resultStr = "";
            foreach (Model.PSystem b in list)
            {
                resultStr += string.Format(str, Gmis.Public.CommonFunction.GetSystemPath() + b.sPicture, b.sTitle, b.sId, b.sNumber);
            }
            return resultStr;
        }
    }
}